 <%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018-6-13
  Time: 20:42
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<meta http-equiv="X-UA-Compatible" content="IE=edge,IE=10,chrome=1">
<%
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy年MM月dd日");

java.util.Date currentTime = new java.util.Date();//得到当前系统时间

String str_date1 = formatter.format(currentTime); //将日期时间格式化
String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式
%>
<%@ include file="/WEB-INF/jsp/sys/css.jsp"%>
<html>
<head>
    <script type = "text/javascript" src = "${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/ctrl/dashboard.js" ></script >
    <script type = "text/javascript" src = "${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/ctrl/dashboardSchedule.js" ></script >
    <script type = "text/javascript" src = "${cp:SYS_VALUE('app.staticfile.home')}/vue/js/echarts.min.js" ></script >
    <link rel = "stylesheet" type = "text/css" href = "${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/css/dashboard.css" >
    <title >陕西省发展与改革委员会协同办公政务一体化平台</title >
    <script>
        window.ContextPath = '<%= request.getContextPath()%>/';
        window.ViewContextPath ='${cp:SYS_VALUE("app.staticfile.home")}/';
        window.nginxpath='${cp:SYS_VALUE("nginxpath")}/';
    </script>
    <style>
	    .layui-table-view .layui-table td.in_use_cls{
	    	cursor: pointer;
	    }
        .layui-table-tips-main{display:none}
        .layui-table-tips-c{display:none}
        .thisdb li{
            display: block!important;
            text-decoration: none;
        }
        .thisdb .layui-this:after{
            border-bottom: none!important;
            border-right: 4px solid #0279D5!important;
            height: 100%;
        }
        .swtable{
            height: 160px;
            margin-top: 90px;
        }
        .swtable td{
            padding: 10px;
        }
        .all{
            font-weight: 700;
            font-size: 20px;
            padding: 10px;
        }
        .dbnum{
            font-weight: 700;
            font-size: 15px;
            padding: 10px;
        }
        #unitMeet td,#unitMeet th{text-align: left;padding: 15px}
        .col1{
            background-color: orange;
        }
        .col2{
            background-color: #FCBC58;
        }
        .col3{
            background-color: #B9CEE3;
        }
        .col4{
            background-color:  #B9CEE3;
        }
        .title{
            text-align: left;
            font-size: 20px;
            font-weight: 200;
            margin-left: 12px;
        }
        .bsfw{width: 98%;margin: auto;    margin-top: 10px;}
        .bsfw th{width: 30% ;
            font-size: 20px;
            font-weight: lighter;}
        .bsfw td{
            font-weight: lighter;
            padding: 10px;
            border-width: 1px;
            border-style: solid;
            border-color: #e6e6e6;
        }
        .bsfw th{
            font-weight: lighter;
            padding: 10px;
            border-width: 1px;
            border-style: solid;
            border-color: #e6e6e6;
        }
        .bsfw img{
            margin-right: 6px;
        }
        .meetNum{
            font-size: 20px;
            color: grey;
        }
        .xmgl_left{
            float: left;
            height: 512px;
            width: 33%;
        }
        .xmgl_right{
            float: left;
            height: 400px;
            width: 66%;
            margin-left: 12px;
            margin-top: -8px;
        }
        .xmgl_bottom_left{
            float: left;
            width: 40%;
            height: 254px;
        }
        .xmgl_bottom_right{
            width: 60%;
            float: right;
        }
        .xmgl_top{
            height: 213px;
        }
        #xmglTop th{
            padding: 10px;
        }
        .xmgltable td{
           padding: 10px;
            width: 28%;
        }
        #xmglTop td{
            padding: 10px;
            width: 26%;
        }
        .title_list_cls p{
            margin-left: 0px;
        }
        #xmglmoney td{width: 20%}
    </style>
</head>
<body>
<body  class="bodyClass">
<input type="hidden" id="menusOwnerHid" value="${menusOwner}">
<div class = "top_div_cls" >
    <div class = "top_info_cls" >
        <p class = "top_left_cls" >
            <span ><iframe style="margin-top: -21px;margin-left: -10px" id="fancybox-frame" name="fancybox-frame1532055508899" frameborder="0" scrolling="no" hspace="0"  src="http://plugin.tianqijun.com/index.php?c=code&id=12&icon=1&num=1&site=12&py=xian"></iframe></span >
        </p >
        <p class = "top_right_cls" >
            <span ><%=str_date1 %></span >
            <span >|</span >
            <span >${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.userInfo.userName}，欢迎您！</span >
            <span >|</span >
            <span ><a rel="sidebar" href="javascript:addFavorite2()">加入收藏</a></span >
           <span >|</span >
            <span ><a href="${cp:SYS_VALUE('app.staticfile.home')}/system/layui/dashWindowPlat">返回首页</a></span >
            <input type="hidden" id="wld" value="${wld}">
            <span >|</span >
            <span ><a href="${cp:SYS_VALUE('app.staticfile.home')}/system/layui/dashWindow?flag=F">切换普通桌面</a></span >
            <span >|</span >
            <span ><a href="javascript:edtiuserinfo()">修改密码</a></span >
            <span >|</span >
            <span ><a href="${cp:SYS_VALUE('app.staticfile.home')}/system/layui/logout">退出</a></span >
        </p >
    </div >
</div >
<div class = "main_div_cls" >
    <div class = "logo_div_cls" >
        <img src = "${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/title.png" alt = "陕西省发展和改革委员会" />
    </div >
    <div style="    width: 200px;
    float: right;
    margin-top: -95px; 
    margin-right:67px"><input type="text" name="searchValue" id="searchValue" autocomplete="off" class="layui-input" value=""/> <a class="layui-btn layui-btn-warm" style="    margin-top: -38px;
    margin-left: 202px;" href="javascript:searchcontent()">搜索</a></div>
    <div class = "rcap_div_cls float_left_cls" >
        <div class = "title_div_cls float_left_cls short" >
            <p class = "title_p_cls" ><img src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/rcaplan.png">日程安排</p >
            <p id="wldmore" class="more_cls" style="display: none" onclick="moreSchedule()">全部</p >
        </div >
        <div class = "rcap_info_div_cls" >
            <div class = "layui-tab layui-tab-brief" >
                <ul class = "layui-tab-title" id="schedule" >
                	 	<li class = "layui-this"  style="width:40%;text-align: left">个人</li >
                    	<li style="width:40%;text-align: left">委领导
                    	<div class = "layui-input-inline" style="display: none;float: right; " id = "wldList">
                            -<span id="wldName"></span>
                            <input id="wldListOpt" style="display: none" value=""/>
                            <div style="margin-top: -37px;margin-left: 71px;" >
                                <img style="width: 26px;height: 26px;margin-left: 5px" onclick="getWlds()" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/qh.png" title="切换" alt="切换"/>
                            </div>
                        </div ></li >
                </ul >
                
                <div class = "layui-tab-content" >
                	  	<div class = "layui-tab-item layui-show" >
                        	<div class = "layui-inline" id = "layDate_gr" ></div >
                    	</div >
                	  	<div class = "layui-tab-item layui-show" >
                        	<div class = "layui-inline" id = "layDate_ld" ></div >
                    	</div >
                </div >
            </div >
        </div >
    </div >
    <div class = "dbsx_div_cls float_left_cls layui-tab layui-tab-brief" >
        <div class = "title_div_cls float_left_cls long" >
            <p class = "title_p_cls" ><img src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/dbsxlan.png">待办事项</p >
            <p class = "more_cls" onclick="moreTodoitems()" >MORE+</p >
        </div >
        <ul class = "layui-tab-title thisdb" style="float: left;width: 135px;border: none;">
            <li class = "layui-this" >
                <img class="gray" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/icon_dysj.png"/>
                <c:if test="${dyscount >0}"> <span class="layui-badge">${dyscount}</span></c:if>
                <div>待阅示件</div>
            </li >
            <li >
                <img class="gray" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/icon_dqfj.png"/>
                <c:if test="${dqfcount >0}"> <span class="layui-badge">${dqfcount}</span></c:if>
                <div>待签发件</div></li >
            <li >
                <img class="gray" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/icon_qtdb.png"/>
                <c:if test="${qtfcount >0}"> <span class="layui-badge">${qtfcount}</span></c:if>
                <div>其他待办</div></li >
        </ul >
        <div class = "layui-tab-content" style="width: 80%;float: right;">
            <div class = "layui-tab-item layui-show" >
                <c:forEach items="${dysitems}" var="row" begin="0" end="5">
                    <div class = "title_list_cls"  onclick="moreAgency('${row.itemUrl}','${row.systemId}')">
                        <p class="bluedb">【${cp:MAPVALUE("ITEMSTATE",row.itemState)}】</p>
                         <p title="${row.itemName}" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;width: 400px">
                                 ${row.itemName}
                           </p ><span ><fmt:formatDate value="${row.createTime}" pattern="yyyy/MM/dd" /></span ></div >
                </c:forEach>
            </div >
            <div class = "layui-tab-item" >
                <c:forEach items="${dqfitems}" var="row" begin="0" end="5">
                    <div class = "title_list_cls"  onclick="moreAgency('${row.itemUrl}','${row.systemId}')">
                        <p class="bluedb">【${cp:MAPVALUE("ITEMSTATE",row.itemState)}】</p> <p title="${row.itemName}" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;width: 400px">
                            ${row.itemName}
                    </p ><span ><fmt:formatDate value="${row.createTime}" pattern="yyyy/MM/dd" /></span ></div >
                </c:forEach>
            </div >
            <div class = "layui-tab-item" >
                <c:forEach items="${qtitems}" var="row" begin="0" end="5">
                    <div class = "title_list_cls"  onclick="moreAgency('${row.itemUrl}','${row.systemId}')">
                        <p class="bluedb">【${cp:MAPVALUE("ITEMSTATE",row.itemState)}】</p>
                        <p title="${row.itemName}" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;width: 400px">
                            ${row.itemName}
                    </p ><span ><fmt:formatDate value="${row.createTime}" pattern="yyyy/MM/dd" /></span ></div >
                </c:forEach>
            </div >
        </div >
    </div >
    <div class = "conentdiv" >
        <div class = "title_div_cls float_left_cls long" >
            <p class = "title_p_cls" ><img src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/cygnlan.png">常用功能</p >
            <p class = "more_cls" onclick="moreAlwaysModel()">MORE+</p >
        </div >
        <div class = ""  id="cygnShow">

        </div >
    </div >
    <div class = "conentdiv" >
        <div class = "title_div_cls float_left_cls long" style="margin-top: 20px">
            <p class = "title_p_cls" ><img src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/xxgslan.png">今日数据</p >
            <p class = "more_cls" onclick="moreAlwaysModel()">MORE+</p >
        </div >
        <div  style="width: 49% ;height: 300px;float: left" class="wlddiv">
            <div  style="width: 64% ;height: 280px;float: left" id="echartPic">

            </div >
            <table class="swtable">
                <tr><td colspan="2">总收发文数<span id="all_all" class="all"></span></td></tr>
                <tr><td >总收文<span id="all_sw" class="dbnum" style="color: #FA6A6A"></span></td><td>收文占比<span id="all_swb" class="dbnum" style="color: #FA6A6A"></span></td></tr>
                <tr><td >总发文<span id="all_fw" class="dbnum" style="color: #7146BA"></span></td><td>发文占比<span id="all_fwb" class="dbnum" style="color: #7146BA"></span></td></tr>
            </table>
        </div >
        <div  style="width: 50% ;height: 300px;float: right" class="wlddiv">
            <div  style="width: 61% ;height: 280px;float: left" id="echartPic2">

            </div >
            <table class="swtable">
                <tr><td colspan="2">今日总收发文数<span id="cu_all" class="all"></span></td></tr>
                <tr><td >今日收文<span id="cu_sw" class="dbnum" style="color: #42C88D"></span></td><td>今日收文占比<span id="cu_swb" class="dbnum" style="color: #42C88D"></span></td></tr>
                <tr><td >今日发文<span id="cu_fw" class="dbnum" style="color: #007CD6"></span></td><td>今日发文占比<span id="cu_fwb" class="dbnum" style="color: #007CD6"></span></td></tr>
            </table>
        </div >
        <div style="height: 400px;float: left;width: 30%" class="wlddiv">
         <div class="title">部门申请会议室TOP5（截止当前）</div>
            <table id="unitMeet">
                <tr><th></th><th >部门</th><th style="width: 40px">次数</th></tr>

            </table>
        </div >
        <div style="height: 432px;float: left;width: 100%;" class="wlddiv">
            <div class="title">办事服务 （<fmt:formatDate value="${maxdate[0].maxdate}" pattern="yyyy-MM-dd"></fmt:formatDate>）</div>
            <table class="bsfw">
                <tr><th colspan="2"><img class="gray" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/icon_xmsp.png"/>项目审批</th>
                    <th colspan="2"><img class="gray" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/icon_xmhz.png"/>项目核准</th>
                    <th colspan="2"><img class="gray" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/icon_xmba.png"/>项目备案</th></tr>
               <tr>
                <c:forEach var="info" items="${xminfo}">
                    <td>预受理</td><td class="meetNum">${info.ysl}</td>
               </c:forEach>
               </tr>
                <tr>
                    <c:forEach var="info" items="${xminfo}">
                        <td>受理</td><td class="meetNum">${info.sl}</td>
                    </c:forEach>
                </tr>
                <tr>
                    <c:forEach var="info" items="${xminfo}">
                        <td>暂停</td><td class="meetNum">${info.zt}</td>
                    </c:forEach>
                </tr>
            </table>
            <div id="bsfwz" style="width: 100%;height: 240px"></div>
        </div >
    </div >
    <div class = "xm_list_div"   class="wlddiv">
        <div style="height: 60px;
    line-height: 60px;" class="wlddiv">
            <div class="title" style="float:left;">陕西省申报项目（<fmt:formatDate value="${maxdate[0].maxdate}" pattern="yyyy-MM-dd"></fmt:formatDate>）</div>
            <div >
                <div style="float: right;padding: 5px;margin-right: 74px;" class="wlddiv">
                <button class="layui-btn layui-btn-primary" onclick="sxxmgl()">陕西省</button>
                </div>
                <div style="float: right;padding: 15px">
                <input type="text" name="year" id="year" placeholder="请选择年度" class="layui-input" readonly>
                </div>
            </div>
        </div>
        <div class="xmgl_left " style="    background-color: white;"  id="xmglMap">地图</div>
        <div class="xmgl_right ">
            <div class="xmgl_top"  style="    background-color: white;" >
                <div class="title" id="sbxmgk">陕西省申报项目概况</div>
                <table class="xmgltable bsfw" id="xmglmoney">
                </table>
            </div>
            <div class="xmgl_bottom"  style="    background-color: white;margin-top: 10px;    height: 289px;" >
                <div class="title" id="xmgltop5">陕西省申报项目行业TOP5</div>
                <div class="xmgl_bottom_left" id="xmglpie" style="    background-color: white;"></div>
                <div class="xmgl_bottom_right" style="    background-color: white;">
                    <table id="xmglTop">


                    </table>

                </div>
            </div>
        </div>
    </div >
</div>
<div style="display:none;" class="rcInfodiv" id="rcInfodiv">

</div>
<div style="position: fixed;float: right;right: 0px;top:200px;width: 100px;height: 300px;background-color: white" id="madiv">
    <img style="cursor: pointer; margin-top: -28px;position: absolute;
    margin-left: 22px;" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/close.png" onclick="close_deal_result()"/>
    <div >
        <img src = "${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/ydbgpt.png" alt = "移动办公平台" />
        <p >移动办公平台</p>
           <p>扫码下载</p >
    </div >
    <div >
        <img src = "${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/wxfwh.png" alt = "微信服务号" />
        <p >微信服务号</p>
        <p>扫码关注</p >
    </div >
</div>
<div style="position: fixed;float: right;right: 0px;top:200px;background-color: white;display: none" id="pendiv">
        <img style="cursor: pointer" src="${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/image/open.png" onclick="open_deal_result()"/>
</div>
<div class = "bottom_div_cls" >
    <div class = "bottom_info_div_cls" >
        <p >主办：陕西省发展和改革委员会&nbsp;&nbsp;&nbsp;&nbsp;陕西省信息中心技术支持</br>地址：新城大院8号楼&nbsp;&nbsp;&nbsp;&nbsp;邮编：710006</p >
    </div >
</div >
</body >
<script>
    function  close_deal_result() {
        $("#madiv").hide();
        $("#pendiv").show();
    }
    function open_deal_result() {
        $("#madiv").show();
        $("#pendiv").hide();
    }
    function searchcontent() {
        var url='${cp:SYS_VALUE('app.staticfile.home')}/modules/dashboard/essearch.jsp';
        url+="?queryWord="+$("#searchValue").val();
        window.open(url);
    }
    $(function(){
        sfwAll();
        sfwCurrDay();
      //  unitMeet();
        bsfwz();
        loadMap("");
        xmgldata("陕西省","","");
        getxmMoney("陕西省","","");
    });
    //委内收发文办件统计饼状图
    function sfwAll(){
        $.ajax({
            type: "get",
            url: window.ViewContextPath + "system/layui/loadsfwAll",
            async: false,
            dataType: "json",
            success: function (data) {
                $("#all_all").html(data.data.all);
                $("#all_sw").html(data.data.sw);
                $("#all_swb").html(data.data.swb);
                $("#all_fw").html(data.data.fw);
                $("#all_fwb").html(data.data.fwb);
                str =data.data.data;
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('echartPic'));
                // 指定图表的配置项和数据
                option = {
                    title : {
                        text: '总收发文统计',
                        subtext: '',
                        x:'center'
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    color:['#7146BA', '#FA6A6A'],
                legend: {
                        orient: 'vertical',
                        left: 'left',
                        data: ['发文','收文']
                    },
                    series : [
                        {
                            name: '总收发文统计',
                            type: 'pie',
                            radius: ['50%', '70%'],
                            avoidLabelOverlap: false,
                            center: ['50%', '50%'],
                            data:str,
                            itemStyle: {
                                emphasis: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            }
        });
    }

    //委内收发文办件当天统计饼状图
    function sfwCurrDay(){
        $.ajax({
            type: "get",
            url: window.ViewContextPath + "system/layui/sfwCurrDay",
            async: false,
            dataType: "json",
            success: function (data) {
                str =data.data.data;
                $("#cu_all").html(data.data.all);
                $("#cu_sw").html(data.data.sw);
                $("#cu_swb").html(data.data.swb);
                $("#cu_fw").html(data.data.fw);
                $("#cu_fwb").html(data.data.fwb);
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('echartPic2'));
                // 指定图表的配置项和数据
                option = {
                    title : {
                        text: '今日收发文统计',
                        subtext: '',
                        x:'center'
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    color:['#007CD6', '#42C88D'],
                    legend: {
                        orient: 'vertical',
                        left: 'left',
                        data:['发文','收文']
                    },
                    series : [
                        {
                            name: '今日收发文统计',
                            type: 'pie',
                            radius: ['50%', '70%'],
                            avoidLabelOverlap: false,
                            center: ['50%', '50%'],
                            data:str,
                            itemStyle: {
                                emphasis: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            }
        });
    }
    function unitMeet() {
        $.ajax({
            type: "get",
            url: window.ViewContextPath + "system/layui/getUnitMeetInfo",
            async: false,
            dataType: "json",
            success: function (data) {
                var str="";
                $.each(data.data,function (i,item) {
                    str+="<tr><td><span class='layui-badge col"+i+"'>"+(i+1)+"</span></td><td>"+item.name+"</td><td class='meetNum'>"+item.count+"</td></tr>";
                });
                $("#unitMeet").append(str);
               /* var name=[];
                var value=[];
                $.each(data.data,function (i,item) {
                    name.push(item.name);
                    value.push(item.count);
                });
                var myChart = echarts.init(document.getElementById('unitMeet'));
                // 指定图表的配置项和数据
                var option = {
                    title: {
                        text: '部门申请会议室统计'
                    },
                    tooltip: {},
                    legend: {
                        data: ['次数']
                    },
                    xAxis: {
                        data: name,
                        axisLabel: {
                            show: true,
                            interval:0,
                            formatter:function(params) {
                                var newParamsName = "";
                                var paramsNameNumber = params.length;
                                var provideNumber = 8;  //一行显示几个字
                                var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
                                if (paramsNameNumber > provideNumber) {
                                    for (var p = 0; p < rowNumber; p++) {
                                        var tempStr = "";
                                        var start = p * provideNumber;
                                        var end = start + provideNumber;
                                        if (p == rowNumber - 1) {
                                            tempStr = params.substring(start, paramsNameNumber);
                                        } else {
                                            tempStr = params.substring(start, end) + "\n";
                                        }
                                        newParamsName += tempStr;
                                    }

                                } else {
                                    newParamsName = params;
                                }
                                return newParamsName
                            }
                        }
                    },
                    yAxis: {},
                    series: [{
                        name: '次数',
                        type: 'bar',
                        data: value
                    }]
                };
                myChart.setOption(option);*/
            }
        });
    }
    function  bsfwz() {
        var data1=[];
        var data2=[];
        var data3=[];
      /*   $.each(${xminfo},function(i,value){
                data1.push(value.ysl);
                data2.push(value.sl);
                data3.push(value.zt);
        }); */
        var myChart = echarts.init(document.getElementById('bsfwz'));
        option = {
            xAxis: {
                type: 'category',
                data: ['项目审批', '项目核准', '项目备案']
            },
            yAxis: {
                type: 'value'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                }
            },
            color:['#007CD6', '#42C88D', 'red'],
            series: [{
                data: data1,
                type: 'bar',
                name:'预受理'
            },{
                data: data2,
                type: 'bar',
                name:'受理'
            },{
                data:data3,
                type: 'bar',
                name:'预报警'
            }]
        };
        myChart.setOption(option);
    }
    /*项目管理开始*/
    var chart = echarts.init(document.getElementById('xmglMap'));
    var city ;
    var cityCode ;
    //地图
    function loadMap(year){
        var maxValue=100;
        var minValue=0;
        $.ajax({
            type: "get",
            url: window.ViewContextPath + "system/layui/getXmglMap",
            data:{"s_year":year},
            async: false,
            dataType: "json",
            success: function (data) {
                var ma=data.data;
                maxValue=ma.max;
                minValue=ma.min;
                //加载地图
                var option = {
                    title:{
                        text:'申报项目概览',
                        subtext:'',
                        left:'center',
                        textStyle:{
                            color:'#008ACD',
                        },
                        subtextStyle:{
                            color:'#008ACD',
                        }
                    },
                    tooltip: {
                        trigger: 'item',
                        formatter: function(params) {
                            var res = params.name+'<br/>';
                            var myseries = option.series;
                            for (var i = 0; i < myseries.length; i++) {
                                for(var j=0;j<myseries[i].data.length;j++){
                                    if(myseries[i].data[j].name==params.name){
                                        res+='项目数：'+(myseries[i].data[j].value?myseries[i].data[j].value:0)+' 个</br>'
                                            +'总投资：'+(myseries[i].data[j].money?myseries[i].data[j].money:0)+' 亿元';
                                    }
                                }
                            }
                            return res;
                        }
                    },
                    visualMap: {
                        min: minValue*0.9,
                        max: maxValue*1.5,
                        calculable: true,
                        realtime: false,
                        inRange: {
                            color: ['#94C6E1','#61AFDD', '#297DDA','#005BC0','#0A4C94','#07305E']
                        },
                        left: 'left',
                        top: 'bottom',
                        text: ['多', '少']
                    }
                    , series: [
                        {
                            name: '陕西省',
                            type: 'map',
                            map: '陕西省',
                            zoom: 1.1,
                            roam: false,
                            selectedMode:"single",
                            data:data.data.mapdata,
                            itemStyle : {
                                normal : {//未选中状态
                                    borderWidth: 0.5,
                                    borderColor:'#ffffff',
                                    label : {
                                        color:'#FF7F50',
                                        show : true
                                    }
                                },
                                emphasis : {// 选中样式
                                    areaColor : '#FE994E',
                                    borderWidth: 0,
                                    label : {
                                        color:'#fff',
                                        show : true,
                                    }
                                }
                            },
                        }
                    ]
                };
                $.get(window.ViewContextPath + '/vue/js/shanxi.json', function(map) {
                    echarts.registerMap('陕西省', map);
                    chart.setOption(option);
                });
                //地图点击展示概况详细
                chart.on('click', function(params) {
                    city = params.data.name;
                    cityCode = params.data.code;
                    var year =$("#year").val();
                    xmgldata(city,cityCode,year);
                    getxmMoney(city,cityCode,year);
                });
            }
        });
    }
    function xmgldata(city,cityCode,year){
        if(typeof(city)=="undefined"||city=="undefined" ){
            city="";
        }
        if(typeof(cityCode)=="undefined"||cityCode=="undefined" ){
            cityCode="";
        }
        var yearn=year
        if(year!=""){
            yearn+="年";
        }
       $("#sbxmgk").html(yearn+city+"申报项目概况");
       $("#xmgltop5").html(yearn+city+"申报项目行业TOP5");
        $.ajax({
            type: "get",
            url: window.ViewContextPath + "system/layui/getXmglInfo",
            data:{"s_city":city,"s_cityCode":cityCode,"s_year":year},
            async: false,
            dataType: "json",
            success: function (data) {
                var str="<tr><th></th><th >行业</th><th style=\"width: 80px\">项目数</th><th style=\"width: 60px\">占比</th></tr>";
                var piedata=[];
                $.each(data.data,function (i,item) {
                    str+="<tr><td><span class='layui-badge col"+i+"'>"+(i+1)+"</span></td><td>"+item.text+"</td><td class='meetNum'>"+item.max+"</td><td class='meetNum'>"+item.zb+"%</td></tr>";
                    piedata.push(item.max);
                });
                $("#xmglTop").empty();
                $("#xmglTop").append(str);
                //项目饼状图
                try {
                    pieoption = {
                        title: {
                            text: ''
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            x: 'right'
                        },
                        radar: [
                            {
                                indicator: data.data,
                                center: ['40%', '45%'],
                                radius: 80
                            }

                        ],
                        series: [
                            {
                                type: 'radar',
                                tooltip: {
                                    trigger: 'item'
                                },
                                itemStyle: {normal: {areaStyle: {type: 'default'}}},
                                data: [
                                    {
                                        value: piedata,
                                        name: '项目'
                                    }
                                ]
                            }
                        ]
                    };
                    var xmglpieChart = echarts.init(document.getElementById('xmglpie'));
                    xmglpieChart.setOption(pieoption);
                }catch (e){

                    }
            }
        });
    }
    layui.use(['laydate'],function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#year',
            type: 'year',
            done: function(value, date, endDate){
                loadMap(value);
                xmgldata(city,cityCode,value);
                getxmMoney(city,cityCode,value);
            }
        });
    });
    function getxmMoney(city,cityCode,year) {
        $.ajax({
            type: "get",
            url: window.ViewContextPath + "system/layui/getxmMoney",
            data:{"s_city":city,"s_cityCode":cityCode,"s_year":year},
            async: false,
            dataType: "json",
            success: function (data) {
                data=data.data;
                try {
                    var str = "<tr><td >投资项目总数/个</td><td>审批类项目/个</td><td >核准类项目/个</td><td colspan='2'>备案类项目/个</td></tr>";
                    str += " <tr><td class=\"meetNum\">" + (data.xmnum[0].numb + data.xmnum[1].numb + data.xmnum[2].numb) + "</td><td class=\"meetNum\">" + data.xmnum[0].numb + "</td><td class=\"meetNum\">" + data.xmnum[1].numb + "</td><td class=\"meetNum\" colspan='2'>" + data.xmnum[2].numb + "</td></tr>"
                    str += "<tr><td >总投资/亿元</td><td>自有资金/亿元</td><td >政府投资/亿元</td><td>银行贷款/亿元</td><td>其他/亿元</td></tr>";
                    str += "<tr><td class=\"meetNum\">" + data.total[0].ta + "</td><td class=\"meetNum\">" + data.total[0].zy + "</td><td class=\"meetNum\">" + data.total[0].zf + "</td><td class=\"meetNum\">" + data.total[0].yh + "</td><td class=\"meetNum\">" + data.total[0].qt + "</td></tr>"
                }catch (e){
                    var str = "<tr><td >投资项目总数/个</td><td>审批类项目/个</td><td >核准类项目/个</td><td colspan='2'>备案类项目/个</td></tr>";
                    str += " <tr><td class=\"meetNum\">" + 0 + "</td><td class=\"meetNum\">" + 0 + "</td><td class=\"meetNum\">" + 0 + "</td><td class=\"meetNum\" colspan='2'>" + 0+ "</td></tr>"
                    str += "<tr><td >总投资/亿元</td><td>自有资金/亿元</td><td >政府投资/亿元</td><td>银行贷款/亿元</td><td>其他/亿元</td></tr>";
                    str += "<tr><td class=\"meetNum\">" + 0 + "</td><td class=\"meetNum\">" +0 + "</td><td class=\"meetNum\">" + 0+ "</td><td class=\"meetNum\">" + 0 + "</td><td class=\"meetNum\">" + 0 + "</td></tr>"
                }
                $("#xmglmoney").html(str);
            }
        });
    }

    function sxxmgl(){
       var year= $("#year").val();
        loadMap(year);
        xmgldata("陕西省","",year);
        getxmMoney("陕西省","",year);
    }
    /*项目管理结束*/
</script>
</html>
